package com.huiminpay.transaction.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiminpay.transaction.entity.PayChannel;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2019-11-15
 */
@Repository
public interface PayChannelMapper extends BaseMapper<PayChannel> {


    /**
     * 查询当前服务下的所有支付通道
     */

    @Select("SELECT pc.ID,pc.CHANNEL_NAME,pc.CHANNEL_CODE FROM pay_channel pc " +
            "join platform_pay_channel ppc on pc.CHANNEL_CODE = ppc.PAY_CHANNEL " +
            "where ppc.PLATFORM_CHANNEL = #{platformChannelCode}")
    List<PayChannel> queryPayChannels(String platformChannelCode);


}
